 //搜索跳转
 $('.fa-search').eq(0).click(function(){
     location.href="../html/sousuo.html";
 })
  // 设置html字体
  $(window).resize(function () {
    var width = $(window).width();
    if (width > 320 && width < 750) {
        var font = 100 / 750 * width;
        $('html').css('fontSize', font + 'px')
    }
})
$(window).resize()
var num = 0
$('.header-two .two-fa').eq(0).click(function (e) {
    e.preventDefault
    num++
    if (num % 2 == 0) {
        $(this).children(".fa-ellipsis-h").show()
        $(this).children(".fa-times").css({ opacity: '0' })
        $(this).siblings().removeClass("down-show")
    } else {
        $(this).children(".fa-ellipsis-h").hide()
        $(this).children(".fa-times").css({ opacity: '1' })
        $(this).siblings().addClass("down-show")
    }
})

function toggleTab() {
    $(".class-list>li").click(function () {
        $(this).addClass("active").siblings().removeClass("active");
        $(".classify-content ul").html("<img class='loading' src='../images/loading.gif'>");
        let brand = $(this).text();
        $.ajax({
            url: '../php/classify.php',
            type: 'get',
            data: {
                brand
            },
            dataType: 'json',
            success: function (data) {
                console.log(1212)
                let html = ``;
                data.forEach(function (item) {
                    html += `<li class="li-item"><div class="li-head">${item.title}</div><div class="classify-wrap"><ul>`;
                    // console.log(JSON.stringify(item.content))
                    let data1 = JSON.parse(item.content);

                    data1.forEach(function (it) {
                        html += ` <li class="goods-box">
                 <div class="lazy-box">
                 <img class="square-lazy" src="${it.imgUrl}" alt="">
                </div>
                  <div class="lazy-name">${it.contentName}</div>
            </li>`
                    })
                    html += `</ul></div></li>`;
                });
                $('.classify-content ul').html(html);
            },
            error: function () {
                console.log(1212)

            }
        })
    })
}
toggleTab();
$(".class-list>li").eq(0).click()